package sctu.edu.java.year2016.team07.huangsuixin.day20160523.chapter6_3;

/**
 * Created by Huang Suixin on 2016/5/23.
 */
/**
 * 3.在项目中创建DateAndTime类，将今天的全部信息格式化后输出，再将日期以“年-月-日”的格式输出。
 */
import java.util.Date;
public class DateAndTime {
    public static void main(String[] args) {
        Date today=new Date();
        System.out.println("今天是"+String.format("%tY",today)+"年"+String.format("%tm",today)+"月"+String.format("%td",today)+"日");
        System.out.println("现在是"+String.format("%tH",today)+":"+String.format("%tM",today)+":"+String.format("%tS",today)+"  "+String.format("%tL",today)+"毫秒");
        System.out.println("12小时制："+String.format("%tp",today)+" "+String.format("%tI",today)+":"+String.format("%tM",today)+":"+String.format("%tS",today)+"  "+String.format("%tL",today)+"毫秒");
        System.out.println("今天是："+String.format("%tF",today));
    }
}
